package menu;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.AbstractButton;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public abstract class MenuWindow extends JFrame implements ActionListener{
	
	public MenuWindow(String string){
		super(string);
		this.setLayout(new BorderLayout());
	}
	
	public void MakeButtonAction(JButton button, String command){
		button.setActionCommand(command);
		button.addActionListener(this);
	}
	
	public void MakeButtonAction(AbstractButton button, String command){
		button.setActionCommand(command);
		button.addActionListener(this);
	}
		
	public abstract void Action(String cmd);
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		String cmd = arg0.getActionCommand();
		Action(cmd);
	}
}
